import javax.swing.JOptionPane;
import java.util.Scanner;
public class faxing

{

    public static void main(String[] args) {

        if ((args != null) && (args.length != 0))
        {

            System.out.println("有参数，用对话框进行输入输出");
           // 男性还是女性？
            String sex,role ;
            while(true)
            {
                sex=JOptionPane.showInputDialog("男性还是女性？（请正确输入）");
                if (sex.equals("男性") ||sex.equals("女性"))  break;
            }
          //  超级英雄还是超级恶棍？
            while(true)
            {
                role=JOptionPane.showInputDialog("超级英雄还是超级恶棍？（请正确输入）");
                if (role.equals("超级恶棍")||role.equals("超级英雄") )  break;
            }

            if(sex.equals("男性") &&role.equals("超级英雄"))
            {
             //牛排还是寿司？;
                String food;
                while (true) {
                    food =JOptionPane.showInputDialog("牛排还是寿司？（请正确输入）");
                    if (food.equals("牛排") || food.equals("寿司")) break;
                }
                if (food.equals("牛排"))   JOptionPane.showMessageDialog(null,"你应该理个平头！");
                else     JOptionPane.showMessageDialog(null,"你应该理个大背头！");
            }


            else if(role.equals("超级恶棍")) JOptionPane.showMessageDialog(null,"你应该理个马希坎式发型！！");

            else
            {
               //动漫还是情景喜剧？
                String movie;
                while(true) {
                    movie = JOptionPane.showInputDialog("动漫还是情景喜剧？(请正确输入)");
                    if (movie.equals("动漫") || movie.equals("情景戏剧")) break;
                }

                if(movie.equals("动漫")) JOptionPane.showMessageDialog(null,"你应该留刘海！");
                else    JOptionPane.showMessageDialog(null,"你应该理个包包头！");
            }

  
  System.exit(0);

      }


        else
        {
            Scanner keyboard=new Scanner(System.in);
            System.out.println("进入字符输入输出界面");

            System.out.println("男性还是女性？");
            String sex ,role ;
            while(true)
            {
                 sex = keyboard.next();
                if (sex.equals("男性") ||sex.equals("女性"))  break;
                else    System.out.println("输入不正确，请重新输入(\"男性或女性\")");
            }
            System.out.println("超级英雄还是超级恶棍？");
            while(true)
            {
                role = keyboard.next();
                if (role.equals("超级恶棍")||role.equals("超级英雄") )  break;
                else    System.out.println("输入不正确，请重新输入(\"超级英雄或超级恶棍\")");
            }


            if(sex.equals("男性") &&role.equals("超级英雄"))
            {
                System.out.println("牛排还是寿司？");
                String food;
                while (true) {
                    food = keyboard.next();
                    if (food.equals("牛排") || food.equals("寿司")) break;
                    else System.out.println("输入不正确，请重新输入(\"牛排或寿司\")");
                }
                if (food.equals("牛排")) System.out.println("你应该理个平头！");
                else System.out.println("你应该理个大背头！");
            }


            else if(role.equals("超级恶棍"))  System.out.println("你应该理个马希坎式发型！！");

            else
            {
                System.out.println("动漫还是情景喜剧？");
                String movie;
                while(true) {
                    movie=keyboard.next();
                    if(movie.equals("动漫")||movie.equals("情景戏剧"))       break;
                    else    System.out.println("输入不正确，请重新输入(\"动漫还是情景喜剧\")");}

                if(movie.equals("动漫"))  System.out.println("你应该留刘海！");
                else    System.out.println("你应该理个包包头！");
            }



        }

    }

}
